#ifndef SERVER_H
#define SERVER_H

#include <QObject>
#include <QHttpServer>
#include <QProtobufSerializer>
class Server : public QObject
{
    Q_OBJECT
public:
    static Server& getInstance() {
        static Server server;
        return server;
    }

    bool init();

private:
    explicit Server(QObject *parent = nullptr);

    QHttpServerResponse searchInterview(const QHttpServerRequest& req);
    QHttpServerResponse searchQuestionCluster(const QHttpServerRequest& req);
    QHttpServerResponse searchCompany(const QHttpServerRequest& req);
    QHttpServerResponse uploadInterview(const QHttpServerRequest& req);

signals:

private:
    QHttpServer _httpServer;
    QProtobufSerializer _serializer;
};

#endif // SERVER_H
